<!DOCTYPE html>
<html class="x-admin-sm">
<head>
    <meta charset="UTF-8">
    <title>添加</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all"/>
    <script src="/layuiadmin/layui/layui.js"></script>
</head>
<body style="background-color:#fff">

<div class="layui-card">
    <div class="layui-card-body">
        <form class="layui-form" action="" class="layui-form layui-form-pane" lay-filter="layui-form-pane" id="sbumitForm">
            <div class="layui-row layui-col-space10 layui-form-item">
                <div class="layui-col-lg6">
                    <label class="layui-form-label">类目：</label>
                    <div class="layui-input-block">
                        <select name="category_id" lay-verify="required">
                            <option value="">请选择类型</option>
                            {foreach $categorys as $v}
                            <option value="{$v.id}">{$v.title}</option>
                            {/foreach}
                        </select>
                    </div>
                </div>
            </div>
            <div class="layui-row layui-col-space10 layui-form-item">
                <div class="layui-col-lg6">
                    <label class="layui-form-label">国家：</label>
                    <div class="layui-input-block">
                        <select name="nation" lay-verify="required" lay-filter="nation" lay-search>
                            <option value="中国" selected>中国</option>
                            <option value="阿尔巴尼亚">阿尔巴尼亚</option>
                            <option value="阿尔及利亚">阿尔及利亚</option>
                            <option value="阿富汗">阿富汗</option>
                            <option value="阿根廷">阿根廷</option>
                            <option value="爱尔兰">爱尔兰</option>
                            <option value="埃及">埃及</option>
                            <option value="埃塞俄比亚">埃塞俄比亚</option>
                            <option value="爱沙尼亚">爱沙尼亚</option>
                            <option value="阿拉伯联合酋长国">阿拉伯联合酋长国</option>
                            <option value="阿鲁巴">阿鲁巴</option>
                            <option value="阿曼">阿曼</option>
                            <option value="安道尔">安道尔</option>
                            <option value="安哥拉">安哥拉</option>
                            <option value="安圭拉">安圭拉</option>
                            <option value="安提瓜和巴布达">安提瓜和巴布达</option>
                            <option value="澳大利亚">澳大利亚</option>
                            <option value="奥地利">奥地利</option>
                            <option value="阿塞拜疆">阿塞拜疆</option>
                            <option value="巴巴多斯">巴巴多斯</option>
                            <option value="巴布亚新几内亚">巴布亚新几内亚</option>
                            <option value="巴哈马">巴哈马</option>
                            <option value="白俄罗斯">白俄罗斯</option>
                            <option value="百慕大">百慕大</option>
                            <option value="巴基斯坦">巴基斯坦</option>
                            <option value="巴拉圭">巴拉圭</option>
                            <option value="巴林">巴林</option>
                            <option value="巴拿马">巴拿马</option>
                            <option value="保加利亚">保加利亚</option>
                            <option value="巴西">巴西</option>
                            <option value="北马里亚纳群岛">北马里亚纳群岛</option>
                            <option value="贝宁">贝宁</option>
                            <option value="比利时">比利时</option>
                            <option value="冰岛">冰岛</option>
                            <option value="博茨瓦纳">博茨瓦纳</option>
                            <option value="波多黎各">波多黎各</option>
                            <option value="波兰">波兰</option>
                            <option value="玻利维亚">玻利维亚</option>
                            <option value="伯利兹">伯利兹</option>
                            <option value="波斯尼亚和黑塞哥维那">波斯尼亚和黑塞哥维那</option>
                            <option value="不丹">不丹</option>
                            <option value="布基纳法索">布基纳法索</option>
                            <option value="布隆迪">布隆迪</option>
                            <option value="朝鲜">朝鲜</option>
                            <option value="赤道几内亚">赤道几内亚</option>
                            <option value="丹麦">丹麦</option>
                            <option value="德国">德国</option>
                            <option value="东帝汶">东帝汶</option>
                            <option value="多哥">多哥</option>
                            <option value="多米尼加">多米尼加</option>
                            <option value="多米尼加共和国">多米尼加共和国</option>
                            <option value="厄瓜多尔">厄瓜多尔</option>
                            <option value="厄立特里亚">厄立特里亚</option>
                            <option value="俄罗斯">俄罗斯</option>
                            <option value="法国">法国</option>
                            <option value="法罗群岛">法罗群岛</option>
                            <option value="梵蒂冈">梵蒂冈</option>
                            <option value="法属波利尼西亚">法属波利尼西亚</option>
                            <option value="斐济">斐济</option>
                            <option value="菲律宾">菲律宾</option>
                            <option value="芬兰">芬兰</option>
                            <option value="佛得角">佛得角</option>
                            <option value="福克兰群岛">福克兰群岛</option>
                            <option value="冈比亚">冈比亚</option>
                            <option value="刚果">刚果（布）</option>
                            <option value="格陵兰">格陵兰</option>
                            <option value="格林纳达">格林纳达</option>
                            <option value="格鲁吉亚">格鲁吉亚</option>
                            <option value="哥伦比亚">哥伦比亚</option>
                            <option value="哥斯达黎加">哥斯达黎加</option>
                            <option value="关岛">关岛</option>
                            <option value="古巴">古巴</option>
                            <option value="圭亚那">圭亚那</option>
                            <option value="海地">海地</option>
                            <option value="韩国">韩国</option>
                            <option value="哈萨克斯坦">哈萨克斯坦</option>
                            <option value="黑山共和国">黑山共和国</option>
                            <option value="荷兰">荷兰</option>
                            <option value="荷属安的列斯群岛">荷属安的列斯群岛</option>
                            <option value="洪都拉斯">洪都拉斯</option>
                            <option value="加纳">加纳</option>
                            <option value="加拿大">加拿大</option>
                            <option value="柬埔寨">柬埔寨</option>
                            <option value="加蓬">加蓬</option>
                            <option value="吉布提">吉布提</option>
                            <option value="捷克共和国">捷克共和国</option>
                            <option value="吉尔吉斯斯坦">吉尔吉斯斯坦</option>
                            <option value="基里巴斯">基里巴斯</option>
                            <option value="几内亚">几内亚</option>
                            <option value="几内亚比绍">几内亚比绍</option>
                            <option value="开曼群岛">开曼群岛</option>
                            <option value="喀麦隆">喀麦隆</option>
                            <option value="卡塔尔">卡塔尔</option>
                            <option value="科科斯群岛">科科斯群岛</option>
                            <option value="克罗地亚">克罗地亚</option>
                            <option value="科摩罗">科摩罗</option>
                            <option value="肯尼亚">肯尼亚</option>
                            <option value="科特迪瓦">科特迪瓦</option>
                            <option value="科威特">科威特</option>
                            <option value="库克群岛">库克群岛</option>
                            <option value="莱索托">莱索托</option>
                            <option value="老挝人民民主共和国">老挝人民民主共和国</option>
                            <option value="拉脱维亚">拉脱维亚</option>
                            <option value="黎巴嫩">黎巴嫩</option>
                            <option value="利比里亚">利比里亚</option>
                            <option value="利比亚">利比亚</option>
                            <option value="列支敦士登">列支敦士登</option>
                            <option value="立陶宛">立陶宛</option>
                            <option value="罗马尼亚">罗马尼亚</option>
                            <option value="卢森堡">卢森堡</option>
                            <option value="卢旺达">卢旺达</option>
                            <option value="马达加斯加">马达加斯加</option>
                            <option value="马尔代夫">马尔代夫</option>
                            <option value="马耳他">马耳他</option>
                            <option value="马来西亚">马来西亚</option>
                            <option value="马拉维">马拉维</option>
                            <option value="马里">马里</option>
                            <option value="曼岛">曼岛</option>
                            <option value="毛里求斯">毛里求斯</option>
                            <option value="毛里塔尼亚">毛里塔尼亚</option>
                            <option value="马其顿">马其顿</option>
                            <option value="马绍尔群岛">马绍尔群岛</option>
                            <option value="马约特">马约特</option>
                            <option value="美国">美国</option>
                            <option value="美属萨摩亚">美属萨摩亚</option>
                            <option value="美属维京群岛">美属维京群岛</option>
                            <option value="蒙古">蒙古</option>
                            <option value="孟加拉国">孟加拉国</option>
                            <option value="蒙塞拉特群岛">蒙塞拉特群岛</option>
                            <option value="缅甸">缅甸</option>
                            <option value="密克罗尼西亚联邦">密克罗尼西亚联邦</option>
                            <option value="秘鲁">秘鲁</option>
                            <option value="摩尔多瓦">摩尔多瓦</option>
                            <option value="摩洛哥">摩洛哥</option>
                            <option value="摩纳哥">摩纳哥</option>
                            <option value="莫桑比克">莫桑比克</option>
                            <option value="墨西哥">墨西哥</option>
                            <option value="纳米比亚">纳米比亚</option>
                            <option value="南非">南非</option>
                            <option value="南极洲">南极洲</option>
                            <option value="瑙鲁">瑙鲁</option>
                            <option value="尼泊尔">尼泊尔</option>
                            <option value="尼加拉瓜">尼加拉瓜</option>
                            <option value="尼日尔">尼日尔</option>
                            <option value="尼日利亚">尼日利亚</option>
                            <option value="纽埃">纽埃</option>
                            <option value="挪威">挪威</option>
                            <option value="帕劳">帕劳</option>
                            <option value="皮特凯恩群岛">皮特凯恩群岛</option>
                            <option value="葡萄牙">葡萄牙</option>
                            <option value="日本">日本</option>
                            <option value="瑞典">瑞典</option>
                            <option value="瑞士">瑞士</option>
                            <option value="萨尔瓦多">萨尔瓦多</option>
                            <option value="塞尔维亚">塞尔维亚</option>
                            <option value="塞拉利昂">塞拉利昂</option>
                            <option value="塞内加尔">塞内加尔</option>
                            <option value="塞浦路斯">塞浦路斯</option>
                            <option value="塞舌尔群岛">塞舌尔群岛</option>
                            <option value="萨摩亚">萨摩亚</option>
                            <option value="沙特阿拉伯">沙特阿拉伯</option>
                            <option value="圣巴泰勒米">圣巴泰勒米</option>
                            <option value="圣诞岛">圣诞岛</option>
                            <option value="圣多美和普林西比">圣多美和普林西比</option>
                            <option value="圣赫勒拿">圣赫勒拿</option>
                            <option value="圣基茨和尼维斯">圣基茨和尼维斯</option>
                            <option value="圣卢西亚">圣卢西亚</option>
                            <option value="圣马丁">圣马丁</option>
                            <option value="圣马力诺">圣马力诺</option>
                            <option value="圣皮埃尔和密克隆">圣皮埃尔和密克隆</option>
                            <option value="圣文森特和格林纳丁斯">圣文森特和格林纳丁斯</option>
                            <option value="斯里兰卡">斯里兰卡</option>
                            <option value="斯洛伐克">斯洛伐克</option>
                            <option value="斯洛文尼亚">斯洛文尼亚</option>
                            <option value="斯威士兰">斯威士兰</option>
                            <option value="苏丹">苏丹</option>
                            <option value="所罗门群岛">所罗门群岛</option>
                            <option value="索马里">索马里</option>
                            <option value="泰国">泰国</option>
                            <option value="塔吉克斯坦">塔吉克斯坦</option>
                            <option value="汤加">汤加</option>
                            <option value="坦桑尼亚">坦桑尼亚</option>
                            <option value="特克斯和凯科斯群岛">特克斯和凯科斯群岛</option>
                            <option value="特立尼达和多巴哥">特立尼达和多巴哥</option>
                            <option value="土耳其">土耳其</option>
                            <option value="土库曼斯坦">土库曼斯坦</option>
                            <option value="突尼斯">突尼斯</option>
                            <option value="托克劳">托克劳</option>
                            <option value="图瓦卢">图瓦卢</option>
                            <option value="瓦利斯和富图纳">瓦利斯和富图纳</option>
                            <option value="瓦努阿图">瓦努阿图</option>
                            <option value="危地马拉">危地马拉</option>
                            <option value="委内瑞拉">委内瑞拉</option>
                            <option value="文莱">文莱</option>
                            <option value="乌干达">乌干达</option>
                            <option value="乌克兰">乌克兰</option>
                            <option value="乌拉圭">乌拉圭</option>
                            <option value="乌兹别克斯坦">乌兹别克斯坦</option>
                            <option value="西班牙">西班牙</option>
                            <option value="希腊">希腊</option>
                            <option value="新加坡">新加坡</option>
                            <option value="新喀里多尼亚">新喀里多尼亚</option>
                            <option value="新西兰">新西兰</option>
                            <option value="匈牙利">匈牙利</option>
                            <option value="叙利亚">叙利亚</option>
                            <option value="牙买加">牙买加</option>
                            <option value="亚美尼亚">亚美尼亚</option>
                            <option value="也门">也门</option>
                            <option value="意大利">意大利</option>
                            <option value="伊拉克">伊拉克</option>
                            <option value="伊朗">伊朗</option>
                            <option value="印度">印度</option>
                            <option value="印度尼西亚">印度尼西亚</option>
                            <option value="英国">英国</option>
                            <option value="英属维京群岛">英属维京群岛</option>
                            <option value="以色列">以色列</option>
                            <option value="约旦">约旦</option>
                            <option value="越南">越南</option>
                            <option value="赞比亚">赞比亚</option>
                            <option value="乍得">乍得</option>
                            <option value="直布罗陀">直布罗陀</option>
                            <option value="智利">智利</option>
                            <option value="中非共和国">中非共和国</option>
                        </select>
                    </div>
                </div>
            </div>

            <div class="layui-row layui-col-space10 layui-form-item" id="div_sheng">
                <div class="layui-col-lg6">
                    <label class="layui-form-label">省份：</label>
                    <div class="layui-input-block">
                        <select name="sheng" id="sheng" lay-filter="sheng">
                        </select>
                    </div>
                </div>
            </div>

            <div class="layui-row layui-col-space10 layui-form-item" id="div_shi">
                <div class="layui-col-lg6">
                    <label class="layui-form-label">市区：</label>
                    <div class="layui-input-block">
                        <select name="shi" id="shi">
                        </select>
                    </div>
                </div>
            </div>
            <div class="layui-form-item" style="margin-top: 60px">
                <div class="layui-input-block">
                    <span class="layui-btn" lay-submit lay-filter="add" style="width: 100%">确认添加</span>
                </div>
            </div>
        </form>
    </div>
</div>

<script>
    //定义数组，存储省份信息
    var province = ["北京", "上海", "天津", "重庆", "浙江", "江苏", "广东", "福建", "湖南", "湖北", "辽宁",
        "吉林", "黑龙江", "河北", "河南", "山东", "陕西", "甘肃", "新疆", "青海", "山西", "四川",
        "贵州", "安徽", "江西", "云南", "内蒙", "西藏", "广西", "宁夏", "海南", "香港", "澳门", "台湾"];

    //定义数组,存储城市信息
    var beijing = ["东城区", "西城区", "海淀区", "朝阳区", "丰台区", "石景山区", "通州区", "顺义区", "房山区", "大兴区", "昌平区", "怀柔区", "平谷区", "门头沟区", "延庆县", "密云县"];
    var shanghai = ["浦东新区", "徐汇区", "长宁区", "普陀区", "闸北区", "虹口区", "杨浦区", "黄浦区", "卢湾区", "静安区", "宝山区", "闵行区", "嘉定区", "金山区", "松江区", "青浦区", "南汇区", "奉贤区", "崇明县"];
    var tianjing = ["河东", "南开", "河西", "河北", "和平", "红桥", "东丽", "津南", "西青", "北辰", "塘沽", "汉沽", "大港", "蓟县", "宝坻", "宁河", "静海", "武清"];
    var chongqing = ["渝中区", "大渡口区", "江北区", "沙坪坝区", "九龙坡区", "南岸区", "北碚区", "万盛区", "双桥区", "渝北区", "巴南区", "万州区", "涪陵区", "黔江区", "长寿区", "江津区", "合川区", "永川区", "南川区"];
    var jiangsu = ["南京", "无锡", "常州", "徐州", "苏州", "南通", "连云港", "淮安", "扬州", "盐城", "镇江", "泰州", "宿迁"];
    var zhejiang = ["杭州", "宁波", "温州", "嘉兴", "湖州", "绍兴", "金华", "衢州", "舟山", "台州", "利水"];
    var guangdong = ["广州", "韶关", "深圳", "珠海", "汕头", "佛山", "江门", "湛江", "茂名", "肇庆", "惠州", "梅州", "汕尾", "河源", "阳江", "清远", "东莞", "中山", "潮州", "揭阳"];
    var fujiang = ["福州", "厦门", "莆田", "三明", "泉州", "漳州", "南平", "龙岩", "宁德"];
    var hunan = ["长沙", "株洲", "湘潭", "衡阳", "邵阳", "岳阳", "常德", "张家界", "益阳", "郴州", "永州", "怀化", "娄底", "湘西土家苗族自治区"];
    var hubei = ["武汉", "襄阳", "黄石", "十堰", "宜昌", "鄂州", "荆门", "孝感", "荆州", "黄冈", "咸宁", "随州", "恩施土家族苗族自治州"];
    var liaoning = ["沈阳", "大连", "鞍山", "抚顺", "本溪", "丹东", "锦州", "营口", "阜新", "辽阳", "盘锦", "铁岭", "朝阳", "葫芦岛"];
    var jilin = ["长春", "吉林", "四平", "辽源", "通化", "白山", "松原", "白城", "延边朝鲜族自治区"];
    var heilongjiang = ["哈尔滨", "齐齐哈尔", "鸡西", "牡丹江", "佳木斯", "大庆", "伊春", "黑河", "大兴安岭"];
    var hebei = ["石家庄", "保定", "唐山", "邯郸", "承德", "廊坊", "衡水", "秦皇岛", "张家口"];
    var henan = ["郑州", "洛阳", "商丘", "安阳", "南阳", "开封", "平顶山", "焦作", "新乡", "鹤壁", "许昌", "漯河", "三门峡", "信阳", "周口", "驻马店", "济源"];
    var shandong = ["济南", "青岛", "菏泽", "淄博", "枣庄", "东营", "烟台", "潍坊", "济宁", "泰安", "威海", "日照", "滨州", "德州", "聊城", "临沂"];
    var shangxi = ["西安", "宝鸡", "咸阳", "渭南", "铜川", "延安", "榆林", "汉中", "安康", "商洛"];
    var gansu = ["兰州", "嘉峪关", "金昌", "金川", "白银", "天水", "武威", "张掖", "酒泉", "平凉", "庆阳", "定西", "陇南", "临夏", "合作"];
    var qinghai = ["西宁", "海东地区", "海北藏族自治州", "黄南藏族自治州", "海南藏族自治州", "果洛藏族自治州", "玉树藏族自治州", "海西蒙古族藏族自治州"];
    var xinjiang = ["乌鲁木齐", "奎屯", "石河子", "昌吉", "吐鲁番", "库尔勒", "阿克苏", "喀什", "伊宁", "克拉玛依", "塔城", "哈密", "和田", "阿勒泰", "阿图什", "博乐"];
    var shanxi = ["太原", "大同", "阳泉", "长治", "晋城", "朔州", "晋中", "运城", "忻州", "临汾", "吕梁"];
    var sichuan = ["成都", "自贡", "攀枝花", "泸州", "德阳", "绵阳", "广元", "遂宁", "内江", "乐山", "南充", "眉山", "宜宾", "广安", "达州", "雅安", "巴中", "资阳", "阿坝藏族羌族自治州", "甘孜藏族自治州", "凉山彝族自治州"];
    var guizhou = ["贵阳", "六盘水", "遵义", "安顺", "黔南布依族苗族自治州", "黔西南布依族苗族自治州", "黔东南苗族侗族自治州", "铜仁", "毕节"];
    var anhui = ["合肥", "芜湖", "安庆", "马鞍山", "阜阳", "六安", "滁州", "宿州", "蚌埠", "巢湖", "淮南", "宣城", "亳州", "淮北", "铜陵", "黄山", "池州"];
    var jiangxi = ["南昌", "九江", "景德镇", "萍乡", "新余", "鹰潭", "赣州", "宜春", "上饶", "吉安", "抚州"];
    var yunnan = ["昆明", "曲靖", "玉溪", "保山", "昭通", "丽江", "普洱", "临沧", "楚雄彝族自治州", "大理白族自治州", "红河哈尼族彝族自治州", "文山壮族苗族自治州", "西双版纳傣族自治州", "德宏傣族景颇族自治州", "怒江傈僳族自治州", "迪庆藏族自治州"];
    var neimenggu = ["呼和浩特", "包头", "乌海", "赤峰", "通辽", "鄂尔多斯", "呼伦贝尔", "巴彦淖尔", "乌兰察布"];
    var guangxi = ["南宁", "柳州", "桂林", "梧州", "北海", "防城港", "钦州", "贵港", "玉林", "百色", "贺州", "河池", "崇左"];
    var xizang = ["拉萨", "昌都地区", "林芝地区", "山南地区", "日喀则地区", "那曲地区", "阿里地区"];
    var ningxia = ["银川", "石嘴山", "吴忠", "固原", "中卫"];
    var hainan = ["海口", "三亚"];
    var xianggang = ["中西区", "湾仔区", "东区", "南区", "九龙城区", "油尖旺区", "观塘区", "黄大仙区", "深水埗区", "北区", "大埔区", "沙田区", "西贡区", "元朗区", "屯门区", "荃湾区", "葵青区", "离岛区"];
    var taiwan = ["台北", "高雄", "基隆", "台中", "台南", "新竹", "嘉义"];
    var aomeng = ["澳门半岛", "氹仔岛", "路环岛"];

    layui.use(['form'], function () {
        $ = layui.jquery;
        var form = layui.form, layer = layui.layer;

        form.on('select(sheng)', function (data) {
            setCity(data.value);
            form.render();
        });

        form.on('select(nation)', function (data) {
            if (data.value == '中国') {
                $("#div_sheng").html('<div class="layui-col-lg6">\n' +
                    '                    <label class="layui-form-label">省份：</label>\n' +
                    '                    <div class="layui-input-block">\n' +
                    '                        <select name="sheng" id="sheng" lay-filter="sheng">\n' +
                    '                        </select>\n' +
                    '                    </div>\n' +
                    '                </div>');
                $("#div_shi").html('<div class="layui-col-lg6">\n' +
                    '                    <label class="layui-form-label">市区：</label>\n' +
                    '                    <div class="layui-input-block">\n' +
                    '                        <select name="shi" id="shi">\n' +
                    '                        </select>\n' +
                    '                    </div>\n' +
                    '                </div>');
                setProvince();
            } else {
                $("#div_sheng").html('');
                $("#div_shi").html('');
            }

            form.render();
        });

        form.on('submit(add)', function () {
            layer.confirm('确认要添加吗？', {icon: 6}, function () {
                $.ajax({
                    type: "POST", //请求方式
                    url: '/admin/banned/add', //请求地址
                    dataType: "json", //返回的数据类型
                    data: $("#sbumitForm").serialize(), //数据
                    //请求成功
                    success: function (data) {
                        if (data.code == 0) {
                            layer.msg(data.msg, {icon: 1, time: 2000}, function () {
                                var index = parent.layer.getFrameIndex(window.name);
                                parent.layer.close(index);
                                window.parent.location.reload();
                            });
                        } else {
                            layer.msg(data.msg, {icon: 2, time: 5000}, function () {
                                var index = parent.layer.getFrameIndex(window.name);
                                parent.layer.close(index);
                            });
                        }
                    },
                    //请求失败
                    error: function (e) {
                        if (e.responseJSON.msg) {
                            layer.msg(e.responseJSON.msg, {icon: 2});
                        }
                    }
                });
            });
        });

        setProvince();
        form.render();
    });

    //设置省份数据
    function setProvince() {
        //给省份下拉列表赋值
        var $sel = $("#sheng");

        //获取对应省份城市
        for (var i = 0, len = province.length; i < len; i++) {
            modelVal = province[i];
            var option = $("<option value='" + province[i] + "'>" + province[i] + "</option>");

            //添加到 select 元素中
            $sel.append(option);
        }
        setCity($($sel.get(0)).val());
    }

    //根据选中的省份获取对应的城市
    function setCity(provinec) {
        var $city = $("#shi");
        var proCity,option, modelVal;

        //通过省份名称，获取省份对应城市的数组名
        switch (provinec) {
            case "北京":
                proCity = beijing;
                break;
            case "上海":
                proCity = shanghai;
                break;
            case "天津":
                proCity = tianjing;
                break;
            case "重庆":
                proCity = chongqing;
                break;
            case "浙江":
                proCity = zhejiang;
                break;
            case "江苏":
                proCity = jiangsu;
                break;
            case "广东":
                proCity = guangdong;
                break;
            case "福建":
                proCity = fujiang;
                break;
            case "湖南":
                proCity = hunan;
                break;
            case "湖北":
                proCity = hubei;
                break;
            case "辽宁":
                proCity = liaoning;
                break;
            case "吉林":
                proCity = jilin;
                break;
            case "黑龙江":
                proCity = heilongjiang;
                break;
            case "河北":
                proCity = hebei;
                break;
            case "河南":
                proCity = henan;
                break;
            case "山东":
                proCity = shandong;
                break;
            case "陕西":
                proCity = shangxi;
                break;
            case "甘肃":
                proCity = gansu;
                break;
            case "新疆":
                proCity = xinjiang;
                break;
            case "青海":
                proCity = qinghai;
                break;
            case "山西":
                proCity = shanxi;
                break;
            case "四川":
                proCity = sichuan;
                break;
            case "贵州":
                proCity = guizhou;
                break;
            case "安徽":
                proCity = anhui;
                break;
            case "江西":
                proCity = jiangxi;
                break;
            case "云南":
                proCity = yunnan;
                break;
            case "内蒙":
                proCity = neimenggu;
                break;
            case "西藏":
                proCity = xizang;
                break;
            case "广西":
                proCity = guangxi;
                break;
            case "宁夏":
                proCity = ningxia;
                break;
            case "海南":
                proCity = hainan;
                break;
            case "香港":
                proCity = xianggang;
                break;
            case "澳门":
                proCity = aomeng;
                break;
            case "台湾":
                proCity = taiwan;
                break;
        }

        //先清空之前绑定的值
        $city.empty();

        $city.append("<option value=''>请选择</option>");

        //设置对应省份的城市
        console.log(proCity);
        for (var i = 0; i < proCity.length; i++) {
            modelVal = proCity[i];
            option = "<option value='" + modelVal + "'>" + modelVal + "</option>";

            //添加
            $city.append(option);
        }
    }

</script>

</body>

</html>
